﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using WaitLess.Business.Data.Model.FourSquare.HereNowResponse;
using WaitLess.Business.Data.Model.FourSquare.VenuesResponse;
using WaitLess.Business.Data.Web;
using WaitLess.Business.Data.Web.Interfaces;
using WaitLess.Business.Repositories;
using WaitLess.Business.Repositories.Interfaces;
using WaitLess.Business.Tests.Common;

namespace WaitLess.Business.Tests.Integration.Repositories.VenuesRepositorySpecifications
{
    [TestClass]
    public class WhenGetStats : AsyncTestBase
    {
        protected IVenuesRepository VenuesRepository { get; private set; }
        protected IWebRequestor WebRequestor { get; private set; }
        protected string VenueId { get; set; }
        protected string AccessToken { get; set; }

        protected object Result { get; set; }

        protected override void Arrange()
        {
            base.Arrange();
            WebRequestor = new WebRequestor();
            VenuesRepository = new VenuesRepository(WebRequestor);

            VenueId = "4caec3a61168a093be0a1d23";
            AccessToken = "VXBBQRYJANHU4PEP1AOJVRBR4DEDPX3TG41XXEJ1NBHAAZ1I";
        }

        protected override void Act()
        {
            VenuesRepository.GetStats(VenueId, AccessToken, result =>
            {
                Result = result;
                IsActCompleted = true;
            });
        }

        [TestMethod]
        public void ThenResultShouldNotBeEmpty()
        {
            Assert.IsNotNull(Result);
        }
    }
}
